{template 'app_header'}
<link rel="stylesheet" href="{MODULE_URL}template/mobile/app/css/linewell_app_qd.css">
<script type="text/javascript">
	$(function() {
		$(".button_yes").click(function(){	
			var insert_data = {};
			{loop $bd_manage['xm'] $row}
				var {$row['zd_name']} = $("#{$row['zd_name']}").val();
				if({$row['zd_name']}=='' || undefined=={$row['zd_name']}){
					$("#code_pop .weui_cell").removeClass('weui_cell_warn')
					$("#{$row['zd_name']}").parent().parent('.weui_cell').addClass('weui_cell_warn');
					_loading_toast._show("请认真填写您的{$row['bd_name']}");
					return;
				}else{
					{if $row['zd_name']=='mobile'}
					var phone = /^1([38]\d|4[57]|5[0-35-9]|7[06-8]|8[89])\d{8}$/;
					if(!phone.test($("#mobile").val())){
						$("#code_pop .weui_cell").removeClass('weui_cell_warn')
						$("#mobile").parent().parent('.weui_cell').addClass('weui_cell_warn');
					   
						_loading_toast._show("请填写正确的手机号码");
						return;
					}
					{/if}
					insert_data.{$row['zd_name']} = $("#{$row['zd_name']}").val();
				}
			{/loop}
			insert_data.rid = "{$rid}";
			_meepoajax._ajax({
				do_it:'bd_insert',
				type: "POST",                        
				dataType: 'json',      
				cache: false,                 
				formPata:insert_data,
				success:function(data) {
					if(data.errno==0){
						_loading_toast._show('签到成功');
						setTimeout(function(){
							location.href="{php echo $this->createMobileUrl('app_qd',array('rid'=>$rid,'t'=>time()))}";
						},500);
					}else{
						_loading_toast._show(data.message);
					}
				}
			});
		});
	});
</script>
</head>
<body>
<img src="{$qd['avatar']}" width="0" height="0"   >
<div class="vgy_user">
        <div class="info2">
        		<img class="touxiang" src="{$user['avatar']}">
            	<p class="name">{$user['nick_name']}</p>
		</div>
		<div class="box">
    		<h1>请填写签到信息</h1>
			<div class="weui_cells weui_cells_form" style="border-bottom-right-radius:20px;border-bottom-left-radius:20px;margin-top:0px">
				{loop $bd_manage['xm'] $row}
					  <div class="weui_cell">
							<div class="weui_cell_hd"><label class="weui_label">{$row['bd_name']}</label></div>
							<div class="weui_cell_bd weui_cell_primary">
							  <input class="weui_input" type="{if $row['zd_name']=='mobile'}tel{else}text{/if}" id="{$row['zd_name']}" placeholder="请填写您的{$row['bd_name']}">
							</div>
					  </div>
				{/loop}
				<div class="but_con">
					<button class="button_yes">签到</button>
				</div>
			</div>
	   </div>
</div>
<div style="position:fixed; z-index:-1;top:0; height:100%; width:100%; opacity:0.3; background:url({$user['avatar']}) no-repeat center top; background-size:100% auto;">
	<div class="bgs" ><img class="bgt" src="{$user['avatar']}"></div>
</div>
{template 'app_footer'}